package t20220307;

import java.util.Scanner;

/**
 * @Author: DengJia
 * @Date: 2022/3/8 22:36
 * @Description:
 */

public class TypeClass {
    private String field1;
    private int field2;
    private long field3;
    private float field4;
    private double field5;

    public TypeClass(String source) {
        Scanner scanner = new Scanner(source);
        scanner.useDelimiter("\\s*,\\s*");
        this.field1 = scanner.next();
        this.field2 = scanner.nextInt();
        this.field3 = scanner.nextLong();
        this.field4 = scanner.nextFloat();
        this.field5 = scanner.nextDouble();
    }

    @Override
    public String toString() {
        return "TypeClass{" +
                "field1='" + field1 + '\'' +
                ", field2=" + field2 +
                ", field3=" + field3 +
                ", field4=" + field4 +
                ", field5=" + field5 +
                '}';
    }
}
